package com.btkjgc.controller.api;

public class JSONResponse
{
	private String command_id = "0";

	private String message = "";

	private String result = "0";

	private String index = "0";

	public JSONResponse()
	{
	}

	public JSONResponse(String command_id, String message, int result,
			String index)
	{
		this.command_id = command_id;
		this.message = message;
		this.result = Integer.toString(result);
		this.index = index;
	}

	public JSONResponse(String command_id, int result, String index,
			String customMessage)
	{
		this.command_id = command_id;
		this.result = Integer.toString(result);
		this.index = index;
		if (!customMessage.equals(""))
			customMessage += " : ";
		switch (result)
		{
		case 0:// 0
			this.message = "请求成功";
			break;

		default:
			this.message = "有地方出错了";
			break;
		}
	}

	public JSONResponse(String command_id, int result, String index)
	{
		this(command_id, result, index, "");
	}

	public String getCommand_id()
	{
		return command_id;
	}

	public String getMessage()
	{
		return message;
	}

	public String getResult()
	{
		return result;
	}

	public void setCommand_id(String command_id)
	{
		this.command_id = command_id;
	}

	public void setMessage(String message)
	{
		this.message = message;
	}

	public void setResult(String result)
	{
		this.result = result;
	}

	public String getIndex()
	{
		return index;
	}

	public void setIndex(String index)
	{
		this.index = index;
	}
}
